using System;
using NUnit.Framework;

namespace Org.JSON.Test.Serialization
{
	[TestFixture]
	public class Object
	{
		[Test]
		public void Empty()
		{
			Assert.AreEqual("{}", new Org.JSON.Object().Serialize());
		}

		[Test]
		public void Single()
		{
			Assert.AreEqual("{\"key\":null}", new Org.JSON.Object().Add("key", new Org.JSON.Null()).Serialize());
		}

		[Test]
		public void Double()
		{
			var obj = new Org.JSON.Object();
			obj.Add("a",new Org.JSON.Boolean(true));
			obj.Add("b", new Org.JSON.Boolean(false));
			Assert.AreEqual("{\"a\":true,\"b\":false}", obj.Serialize());
		}

		[Test]
		public void Inner()
		{
			Assert.AreEqual("{\"a\":{}}", new Org.JSON.Object().Add("a", new Org.JSON.Object()).Serialize());
		}

	}
}

